package com.boang.entity;

/*
    @author:sa
    @date:2024/11/19 16:25
*/
public class CreditAccount extends Account implements IRepay{
public int celling;
    public CreditAccount(String cardNo, String passwd, int balance) {
        super(cardNo, passwd, balance);
    }

    @Override
    public void save(int money) {
    }

    @Override
    public void deposit(int m) {
        int total=this.balance+celling;
        if (m >celling) {
            throw new ArrayIndexOutOfBoundsException("余额不足");
        }else {
        total-=m;}
    }
    @Override
   public void loan(){
      this.celling=10000;
  }
}